﻿Chenxin.UI.CounterfeiTraceManage = Chenxin.extend(Chenxin.UI.PageCommon, {
    autoInitForm: false,
    actionUrl: 'service/traceHandler.ashx',
    createGrid: function() {
        return new Chenxin.UI.Pagination({
            actionUrl: this.actionUrl + '?op=getcounterfeilist',
            id: 'a',
            pageSize: 50,
            renderTo: 'counterfeittrace_table',
            data: {}
        });
    },
    alldel: function() {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            url: this.actionUrl,
            data: { op: 'alldel', id: _this.currentId },
            onSuccess: function(data, msg) {
                alert(msg);
            }
        });
    },
    remove: function() {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            url: this.actionUrl,
            data: { op: 'remove', id: _this.currentId },
            onSuccess: function(data, msg) {
                alert(msg);
            }
        });
    },
    cancle: function() {
    },
    initEvent: function() {
        var _this = this;
        $('.tr_del').live('click', function() {
            _this.currentId = this.name;
            _this.remove();
            _this.grid.reload();
        });
        $('.alldel').live('click', function() {
            _this.currentId = this.name;
            _this.alldel();
            _this.grid.reload();
        });
        $('.export').live('click', function() {
            _this.exportData();
        });
    },
    initComponent: function() {
        Chenxin.UI.CounterfeiTraceManage.superclass.initComponent.call(this);
    }
});

$(document).ready(function(){
	var traceMgr=new Chenxin.UI.CounterfeiTraceManage();	
});





